import torch
import numpy as np
from torch import nn 
from torch.autograd import Variable
import torch.nn.functional as F
from utils import train
from torch.utils.data import DataLoader
from datetime import datetime
import Res_sensor
from Res_sensor import tf_resnet

res_net_test = Res_sensor.net_sensor(1)
res_net_test.load_state_dict(torch.load('weight.pth'))
res_net_test.eval()
test_data = np.loadtxt('data\data2.txt')
test = Variable(tf_resnet(test_data[600:605,0:-2]))
label_test = res_net_test(test)
la = np.array(label_test.data,dtype='float32')
np.set_printoptions(precision=2)
print(test_data[600:605,-2])
print(la.dot(1000).reshape(1,5))

